<?php

namespace Sifast\ProjectBundle\Admin;

use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;

class SituationFamilleAdmin extends Admin
{
 
    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper
            ->with('L1')
            ->add('statut', 'choice', array(
                    'label'=> 'Statut:',
                    'choices' => array(
                        'Choisir le statut' => 'Choisir le statut',
                        'Célibataire' => 'Célibataire',
                        'En couple' => 'En couple',
                        'En couple' => 'En couple',
                        'Marié' => 'Marié',
                        'Veuf' => 'Veuf',
                        'Divorcé' => 'Divorcé',
                    )
                ))
            ->add('dateFin', 'date', array(
                    'label'=> 'Date de fin:',
                    'widget' => 'single_text',
                    'format' => 'MM/dd/yyyy',
                    'attr' => array('class' => 'datepicker')
                ))
            ->end() 
            ->with('L2')    
            ->add('dateDebut', 'date', array(
                    'label'=> 'Date de debut:',
                    'widget' => 'single_text',
                    'format' => 'MM/dd/yyyy',
                    'attr' => array('class' => 'datepicker')
                ))
            ->end()    
            ;
            
    }

    protected function configureDatagridFilters(DatagridMapper $datagridMapper)
    {
        $datagridMapper
            ->add('statut')
            ->add('dateDebut')
            ->add('dateFin');
            
    }

    protected function configureListFields(ListMapper $listMapper)
    {
        $listMapper
            ->addIdentifier('statut')
            ->add('dateDebut')
            ->add('dateFin');
            
            }
}